<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!--引入 element-ui 的样式，-->
    <link rel="stylesheet" href="/admin/plugin/element-ui/index.css">
    <!-- 必须先引入vue，  后使用element-ui -->
    <script type="text/javascript" src="/admin/js-css/js/vue.min.js"></script>
    <!-- 引入element 的组件库-->
    <script type="text/javascript" src="/admin/plugin/element-ui/index.js"></script>

    <script type="text/javascript" src="/admin/plugin/element-ui/httpVueLoader.js"></script>

    <!--引入layui组件-->
    <link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
    <script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="/admin/js-css/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/mx1.0.js?v=1.1"></script>
	<link rel="stylesheet" href="/admin/js-css/css/backColor.css" media="all">
    <style>
        /* 为所有具有滚动条的元素自定义滚动条样式 */
        ::-webkit-scrollbar {
            width: 1px; /* 设置滚动条的宽度 */
        }

    </style>
</head>
<body>
<div id="app">
    <el-tree :lazy="true" :highlight-current="true" :default-expanded-keys="treeData" node-key="id" :props="defaultProps" :expand-on-click-node="false" :load="getData" @node-click="handleNodeClick"></el-tree>
</div>

<script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>
<script>

    var vm = new Vue({
        el: '#app',
        data: {
            treeData:["0000"],
            defaultProps: {
                children: 'children',
                label: 'title'
            }
        },
        created(){
            // this.getData();
        },
        methods:{
            handleNodeClick(treeNode) {
                top.data.zygl_id = treeNode.id;
                let itembread = top.vm.getBreadcrumb();
                itembread.three = treeNode.title;
                top.vm.setBreadcrumb(itembread);
                parent.vm.setUrl("/admin/html/columnManagement/list.html?v="+guid());
            },
            //获取数据
            async getData(item,resolve){
                let parms = {};
                if(item.data == undefined){
                    parms = {token:localStorage.getItem("token")};
                }else {
                    parms = {id:item.data.id,type:item.data.type,token:localStorage.getItem("token")};
                }
                const res = await post("/admin/api/DataManagementController/queryChildNodeData",parms);
                let listdata = [];
                for(let a=0;a<res.length;a++){
                    listdata.push({
                        title: res[a].name
                        ,id: res[a].id,
                        tableId:res[a].tableId,
                        type:res[a].type,
                        order_col:res[a].order_col,
                        inputurl:res[a].url,
                        list_url:res[a].list_url,
                        children:[{title:"",id:""}]
                    });
                }
                resolve(listdata);
            }
        }
    });



</script>
</body>
</html>